const fs = require('fs')
const express = require('express')
const io = require('./io')
const path = require('path')
const app = express()

const credentials = { 
  key: fs.readFileSync(path.resolve(__dirname,'../lls/key.pem'),'utf-8'),
  cert: fs.readFileSync(path.resolve(__dirname,'../lls/server.crt'),'utf-8')
}

const server = require('https').createServer(credentials,app)
// const server = require('https').createServer(credentials,app)

app.use('/',express.static('dist'))


io.attach(server)

server.listen(3000,() => {
  console.log('服务已启动: https://localhost:3000');
})


